﻿Imports System.Data
Imports System.Data.Odbc
Imports WSEntidades
Public Class MoventFact
    Public Shared Function Build(ByVal dr As OdbcDataReader) As MoventBE
        Dim tmpMovent As MoventBE = New MoventBE()
        Try
            With tmpMovent
                .CantEnt = convertDTFromDb.ConvertDecimal(dr.Item("CantEnt"))
                .Cantidad = convertDTFromDb.ConvertDecimal(dr.Item("Cantidad"))
                .CantUM1 = convertDTFromDb.ConvertString(dr.Item("CantUM1"))
                .ClaMoneda = convertDTFromDb.ConvertString(dr.Item("ClaMoneda"))
                .ClaProducto = convertDTFromDb.ConvertString(dr.Item("ClaProducto"))
                .Costo = convertDTFromDb.ConvertString(dr.Item("Costo"))
                .CostoReal = convertDTFromDb.ConvertDecimal(dr.Item("CostoReal"))
                .DescPar = convertDTFromDb.ConvertDecimal(dr.Item("DescPar"))
                .descripcion = convertDTFromDb.ConvertString(dr.Item("descripcion"))
                .Estado = convertDTFromDb.ConvertString(dr.Item("Estado"))
                .FecComSal = convertDTFromDb.convertDateTime(dr.Item("FecComSal"))
                .FecEnt = convertDTFromDb.convertDateTime(dr.Item("FecEnt"))
                .Fisico = convertDTFromDb.convertInt32(dr.Item("Fisico"))
                .Id = convertDTFromDb.convertInt32(dr.Item("Id"))
                .IdEmpresa = convertDTFromDb.ConvertShort(dr.Item("IdEmpresa"))
                .ImpDesc = convertDTFromDb.ConvertDecimal(dr.Item("ImpDesc"))
                .ImpIva = convertDTFromDb.ConvertDecimal(dr.Item("ImpIva"))
                .NumCuenta = convertDTFromDb.ConvertString(dr.Item("NumCuenta"))
                .NumEnt = convertDTFromDb.convertInt32(dr.Item("NumEnt"))
                .Partida = convertDTFromDb.convertInt32(dr.Item("Partida"))
                .PorIva = convertDTFromDb.ConvertDecimal(dr.Item("PorIva"))
                .PrecioFac = convertDTFromDb.ConvertDecimal(dr.Item("PrecioFac"))
                .PrecioUM1 = convertDTFromDb.ConvertString(dr.Item("PrecioUM1"))
                .PrecioUni = convertDTFromDb.ConvertDecimal(dr.Item("PrecioUni"))
                .Serie = convertDTFromDb.ConvertString(dr.Item("Serie"))
                .Status = convertDTFromDb.ConvertString(dr.Item("Status"))
                .UniMed = convertDTFromDb.ConvertString(dr.Item("UniMed"))
            End With
            Return tmpMovent
        Catch ex As Exception
            Throw
        Finally
            tmpMovent = Nothing
        End Try
    End Function
End Class
